/*
 * @Description: 类及其类型
 * @Autor: HuiSir<273250950@qq.com>
 * @Date: 2021-04-30 15:02:46
 * @LastEditTime: 2021-04-30 17:37:05
 */
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
/* 类演示 */
var P = /** @class */ (function () {
    // 构造函数
    function P(name, age, gender) {
        if (gender === void 0) { gender = "男"; }
        // 注意：在函数的参数中若有默认值，在传参时是可以不传的。
        // 但此参数必须放到参数的末尾，若放到开始，则也是必传
        this.name = name;
        this.age = age;
        this.gender = gender;
    }
    P.prototype.sayHi = function (str) {
        console.log("Hello ".concat(this.name, "\uFF0C") + str);
    };
    return P;
}());
var p = new P("小明", 18, "男");
p.sayHi("我爱你！"); // Hello 小明，我爱你！
var A = /** @class */ (function (_super) {
    __extends(A, _super);
    function A() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.id = Date.now();
        return _this;
        // setAge(age: number) {
        //     this.age = age
        // }
    }
    A.prototype.sayHello = function () {
        console.log("Hello Typescript");
    };
    return A;
}(P));
var a = new A("小红", 12, "女");
a.sayHello(); // Hello Typescript
